const express = require('express');
const https = require('https');
const fs = require('fs');
let app = express();
let router = require('./routes/router');
var cors = require('cors');
var options = {
  key: fs.readFileSync('./cret/5811049_dmyg.xyz.key'),
  cert: fs.readFileSync('./cret/5811049_dmyg.xyz.pem'),
};
const bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cors());
app.use(router);

https.createServer(options, app).listen(3000, function () {
  console.log('Https server listening on port ' + 3000);
});
